<!-- 
  * Copyright (c) 2022 iSoftStone Information Technology (Group) Co.,Ltd.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
 -->
<template>
	<view>
		<view class="issueBox">
			<view class="content">
				<view class="title">请复制下方链接，使用电脑浏览器打开，以发布您的文章</view>
			</view>
			<u-textarea :disabled="true" v-model="value1" :placeholder="value1"></u-textarea>
			<view class="copy">
				<u-link :href="value1" text="复制"></u-link>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				value1: "http://localhost::9002/admin/articleadd"
			}
		},
		computed: {},
		onShow() {
			const user = this.$store.state.$userInfo
			this.value1 = "http://localhost::9002/admin/articleadd?openId=" + encodeURI(user.openId) +
				"&userId=" + encodeURI(user.id) + "&username=" + encodeURI(user.userName)
		},
		methods: {
			copyClick() {
				uni.setClipboardData({
					data: 'https://modao.cc/app/mhHxfgcr7omyfpFJ85aA#screen=sl06mmmoxpw1omh',
					success: function() {
						console.log('success');
					}
				});
				uni.getClipboardData({
					success: function(res) {
						console.log(res.data);
						uni.$u.toast('复制成功')
					}
				});
			}
		}
	}
</script>
<style lang="scss" scoped>
	.issueBox {
		margin-top: 16rpx;
		background: #FFFFFF;
		padding: 44rpx 24rpx 50rpx 24rpx;

		/deep/ button::after {
			border: none;
		}

		.content {
			.title {
				font-size: 32rpx;
				color: #000000;
				font-weight: bold;
				margin-bottom: 16rpx;
			}
		}

		.copy {
			font-size: 30rpx;
			color: #317AF7;
			text-align: center;
			line-height: 42rpx;
			font-weight: 400;
			margin-top: 36rpx;

			/deep/ .u-link {
				text-align: center;
				display: block !important;
			}
		}

		/deep/ .u-input__content__field-wrapper {
			font-size: 28rpx;
			height: 144px !important;
			border-radius: 8rpx !important;
		}
	}
</style>
